package org.jeecg.modules.music.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

@Data
@TableName("mus_category")
public class MusCategory implements Serializable {
    private static final long serialVersionUID = 1L;

    /**ID*/
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    /**父机构ID*/
    private String parentId;

    /**机构/部门名称*/
    @Excel(name="分类名称",width=15)
    private String categoryName;




    /**地址*/
    @Excel(name="logo",width=15)
    private String logo;
    /**备注*/
    @Excel(name="备注",width=15)
    private String memo;

    /**机构类别 1=一级分类，2=二级分类，3=三级分类*/
    @Excel(name="类别",width=15,dicCode="mus_category")
    private String musCategory;
    /**机构类型*/
    private String musType;
    /**机构编码*/
    @Excel(name="编码",width=15)
    private String musCode;

    /**排序*/
    @Excel(name="排序",width=15)
    private Integer categoryOrder;

    /**状态（1启用，0不启用）*/
    @Dict(dicCode = "depart_status")
    private String status;

    /**删除状态（0，正常，1已删除）*/
    @Dict(dicCode = "del_flag")
    @TableLogic
    private String delFlag;
    /**创建人*/
    private String createBy;
    /**创建日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**更新人*/
    private String updateBy;
    /**更新日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 重写equals方法
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        MusCategory category = (MusCategory) o;
        return Objects.equals(id, category.id) &&
                Objects.equals(parentId, category.parentId) &&
                Objects.equals(categoryName, category.categoryName) &&
                Objects.equals(categoryOrder, category.categoryOrder) &&
                Objects.equals(musCategory, category.musCategory) &&
                Objects.equals(musType, category.musType) &&
                Objects.equals(musCode, category.musCode) &&
                Objects.equals(memo, category.memo) &&
                Objects.equals(status, category.status) &&
                Objects.equals(delFlag, category.delFlag) &&
                Objects.equals(createBy, category.createBy) &&
                Objects.equals(createTime, category.createTime) &&
                Objects.equals(updateBy, category.updateBy) &&
                Objects.equals(updateTime, category.updateTime);
    }

    /**
     * 重写hashCode方法
     */
    @Override
    public int hashCode() {

        return Objects.hash(super.hashCode(), id, parentId, categoryName,
                categoryOrder,musCategory,
                musType, musCode,memo, status,
                delFlag, createBy, createTime, updateBy, updateTime);
    }
}
